<template>
	<view class="layout">
		<view class="navbar" >
			<view class="statusBar" :style="{height:getStatusBarHeight() + 'px'}"></view>
			<view class="titleBar" :style="{height:getTitleBarHeight() + 'px'}">
				<view class="title">
					标题
				</view>
				<view class="search">
					<uni-icons class="icon" type="search" color="#888" size="18"></uni-icons>
					<text class="text">搜索</text>
				</view>
			</view>
		</view>
		<view class="fill" :style="{height:getNavBarHeight() + 'px'}">

		</view>
	</view>
</template>

<script lang="ts" setup>
	import{getStatusBarHeight,getTitleBarHeight,getNavBarHeight} from "@/utils/system.js";
	 //状态栏高度
	
	//胶囊按钮高度  实际高度加上上下的边距
	// let {top,height} = uni.getMenuButtonBoundingClientRect()
	// let titleBarHeight =ref((top-statusBarHeight.value) * 2 + height)
	
</script>

<style lang="scss" scoped>
	.navbar {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		z-index: 99;
		background:
			linear-gradient(to bottom, transparent, #fff 400rpx),
			linear-gradient(to right, #beecd8 20%, #F4E2D8);

		.statusBar {}

		.titleBar {
			display: flex;
			align-items: center;
			padding: 0 30rpx;

			.title {
				font-size: 22px;
				color: #000;
				font-weight: 700;
			}

			.search {
				display: flex;
				align-items: center;
				width: 220rpx;
				height: 60rpx;
				border-radius: 60rpx;
				background: rgba(225, 225, 225, 0.4);
				border: 1px solid #fff;
				margin-left: 30rpx;
				color: #fff;
				font-size: 28rpx;

				.icon {
					margin-left: 8rpx;
				}

				.text {
					color: #888;
					padding-left: 10rpx
				}
			}
		}




	}

	.fill {}
</style>